
export const useData = () => {
    const treeNodeImg = ref(["company", "department", "car", "people", "channel", "", "", "", "", "", ""]);
    const carState = ref(["driving.png", "stop.png", "flameout.png", "positioningFail.png", "offline.png", "notLocate.png"]);
    const myTree = ref(null);
    const showTree = ref(true);
    const loading = ref(false);
    const filterText = ref('');
    const expandedkeys = ref([]);
    let timer = null;
    function debounce(func) {
        if (timer) {
            clearTimeout(timer)
        }
        timer = setTimeout(function () {
            func.call()
        }, 300)
    }
    return {
        treeNodeImg,
        carState,
        myTree,
        showTree,
        loading,
        expandedkeys,
        filterText,
        debounce
    }
}